package com.ynding.cloud.auth.server.admin.service.api.impl;

import com.ynding.cloud.auth.api.admin.api.IResourceApiService;
import com.ynding.cloud.auth.server.admin.service.IResourceService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.security.access.ConfigAttribute;

import java.util.List;
import java.util.Set;

/**
 * <p> </p>
 *
 * @author ynding
 * @version 2021/9/10
 **/
@DubboService(version = "1.0.0", timeout = 5000)
@Slf4j
@RequiredArgsConstructor
public class ResourceApiServiceImpl implements IResourceApiService {

    private final IResourceService resourceService;

    @Override
    public List<ConfigAttribute> getAttributes(String requestUrl) {
        return resourceService.getAttributes(requestUrl);
    }

    @Override
    public Set<String> findResourcesByUsername(String username) {
        return resourceService.findResourcesByUsername(username);
    }
}
